﻿// -----------------------------------------------------------------------
// <copyright file="IndexBitmixColor.cs" company="Image Processing Course Project">
// Created 13/12/2011
// </copyright>
// -----------------------------------------------------------------------

namespace ImageProcessing.IntermediateClasses
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    /// <summary>
    /// Class inherited from IComparable carrying Noise.Index value and bitmixColor value
    /// </summary>
    public class IndexBitmixColor : IComparable
    {
        /// <summary>
        /// Noise.Index struct value
        /// </summary>
        private Noise.Index index;

        /// <summary>
        /// BitmixColor int value
        /// </summary>
        private int bitmixColor;

        /// <summary>
        /// Gets or sets pixel index
        /// </summary>
        public Noise.Index Index
        {
            get
            {
                return this.index;
            }

            set
            {
                this.index = value;
            }
        }

        /// <summary>
        /// Gets or sets pixel BitmixColor value
        /// </summary>
        public int BitmixColor
        {
            get
            {
                return this.bitmixColor;
            }

            set
            {
                this.bitmixColor = value;
            }
        }

        /// <summary>
        /// Compare 2 objects by BitmixColor value
        /// </summary>
        /// <param name="obj">Object to compare this object to</param>
        /// <returns>1 if this object is greater than or equal the given object. -1 otherwise</returns>
        public int CompareTo(object obj)
        {
            IndexBitmixColor otherColor = (IndexBitmixColor)obj;

            if (this.BitmixColor >= otherColor.BitmixColor)
            {
                return 1;
            }
            else
            {
                return -1;
            }
        }
    }
}
